<?=$this->load->view('include_header',null)?>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/eg_tourism_update/'.$cateid)?>">

	<h3>埃及旅游申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  
		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />
			</td>
        </tr>
    </tfoot>

    <tbody>
	    <tr class="odd">
            <td colspan="5">
			<input type="radio" name="consulate_type" value="1" <?= (@$info->consulate_type==1)?'checked':''?> />北京领区
			<input type="radio" name="consulate_type" value="2" <?= (@$info->consulate_type==2)?'checked':''?> />上海领区</td>
        </tr>
        <tr class="odd">
            <td colspan="5">1.	Personal Data</td>
        </tr>
        <tr class="even">
            <td>Family Name(姓)</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>First Name(名)</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
        </tr>
        <tr class="odd">
            <td>Place of Birth(出生地)</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
            <td>&nbsp;</td>
            <td>Date of Birth(生日)</td>
            <td><select name="birth_d"><?php for($i=1;$i<=31;$i++) echo "<option value='$i'".((@$info->birth_d==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_m"><?php for($i=1;$i<=12;$i++) echo "<option value='$i'".((@$info->birth_m==$i)?"selected":"").">$i</option>"; ?></select> - 
			<select name="birth_y"><?php for($i=date("Y");$i>1940;$i--) echo "<option value='$i'".((@$info->birth_y==$i)?"selected":"").">$i</option>"; ?></select></td>
        </tr>
        <tr class="even">
            <td>Sex（性别）</td>
            <td>
<input type="radio" name="sex" value="1" <?= (@$info->sex==1)?'checked':''?> />Male（男） 
<input type="radio" name="sex" value="2" <?= (@$info->sex==2)?'checked':''?> />Female（女）</td>
            <td>&nbsp;</td>
            <td>Marital Status（婚姻状况）</td>
            <td>
			<input type="text" name="marital_status" value="<?= @$info->marital_status?>" />
			</td>
        </tr>
        <tr class="odd">
            <td>Occupation（职业）</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
			<td>&nbsp;</td>
			<td>Permanent address（永久居住地址）</td>
			<td><input type="text" name="address" value="<?= @$info->address?>" /></td>
        </tr>
        <tr class="even">
          <td>Telephone（电话）</td>
		  <td><input type="text" name="tel" value="<?= @$info->tel?>" /></td>
		  <td>&nbsp;</td>
		  <td>Nationality（国籍）</td>
		  <td><input type="text" name="nationality" value="<?= @$info->nationality?>" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5">2.	Traveling Document</td>
        </tr>
        <tr class="even">
            <td>Passport Type and Number(护照类型和号码)</td>
		  <td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
		  <td>&nbsp;</td>
		  <td>Issued at(护照签发地)</td>
		  <td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
        </tr>
        <tr class="odd">
            <td>Issued on(护照签发时间)</td>
            <td><input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /></td>
            <td>&nbsp;</td>
            <td>Expires(护照到期时间)</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
        </tr>
        <tr class="even">
            <td colspan="5">3.	Traveling to Eygpt</td>
        </tr>
	   <tr class="odd">
            <td>Purspose of Visit(出访目的)</td>
            <td>
 <input type="radio" name="purspose" value="1" <?= (@$info->purspose==1)?'checked':''?>/> Tourism （旅游） <br />
 <input type="radio" name="purspose" value="2" <?= (@$info->purspose==2)?'checked':''?>/> Business （商务）<br />
 <input type="radio" name="purspose" value="3" <?= (@$info->purspose==3)?'checked':''?>/> Transit （过境） <br />
 <input type="radio" name="purspose" value="4" <?= (@$info->purspose==4)?'checked':''?>/> Work （工作）
 </td>
			<td>&nbsp;</td>
            <td>Type of entry</td>
			<td>
 <input type="radio" name="entry_type" value="1" <?= (@$info->entry_type==1)?'checked':''?>/> Single  (一次) <br />
 <input type="radio" name="entry_type" value="2" <?= (@$info->entry_type==2)?'checked':''?>/> Multiple (多次)</td>
        </tr>
        <tr class="even">
            <td>Address in Eygpt (在埃及的地址)</td>
            <td colspan="4"><input type="text" name="egypt_address" value="<?= @$info->egypt_address?>" style="width:300px" /></td>
        </tr>		
        <tr class="odd">
            <td>Duration of stay(居留时间)</td>
            <td><input type="text" name="stay_length" value="<?= @$info->stay_length?>" /></td>
            <td>&nbsp;</td>
            <td>Previous Travel to Eygpt(是否去过埃及)</td>
			<td><input type="radio" name="is_travel_before" value="1" <?= (@$info->is_travel_before==1)?'checked':''?>/> Yes /是
			<input type="radio" name="is_travel_before" value="0" <?= (@$info->is_travel_before==0)?'checked':''?>/> No/否
			<br/>(IF YES) DATE<input type="text" name="travel_before_date" value="<?= @$info->travel_before_date?>" id="travel_before_date" />
</td>
        </tr>
        <tr class="odd">
            <td colspan="5">4. Accompanying Family members(随行家庭成员)</td>
        </tr>
        <tr class="even">
            <td colspan="5">
Name(姓名)<input type="text" name="member_name1" value="<?= @$info->member_name1?>" /> &nbsp;&nbsp;Relationship（关系）<input type="text" name="member_relate1" value="<?= @$info->member_relate1?>" /> &nbsp;&nbsp;Date and place birth（出生日期和地点）<input type="text" name="member_birth1" value="<?= @$info->member_birth1?>" /><br />
Name(姓名)<input type="text" name="member_name2" value="<?= @$info->member_name2?>" /> &nbsp;&nbsp;Relationship（关系）<input type="text" name="member_relate2" value="<?= @$info->member_relate2?>" /> &nbsp;&nbsp;Date and place birth（出生日期和地点）<input type="text" name="member_birth2" value="<?= @$info->member_birth2?>" /><br/>
Name(姓名)<input type="text" name="member_name3" value="<?= @$info->member_name3?>" /> &nbsp;&nbsp;Relationship（关系）<input type="text" name="member_relate3" value="<?= @$info->member_relate3?>" /> &nbsp;&nbsp;Date and place birth（出生日期和地点）<input type="text" name="member_birth3" value="<?= @$info->member_birth3?>" /><br/></td>
        </tr>

    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		consulate_type:"required",
		surname:"required",
		firstname:"required",
		travel_document_num:"required",
		travel_document_issue_by:"required",
		travel_document_valid_date:"required",
		travel_document_issue_date:"required",
		sex:"required",
		marital_status:"required",
		purspose:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#travel_before_date").datepicker();


	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>